<template>
  <div class="consensus-activity-my">
    <c-title text="我的"></c-title>
    <div class="head">
      <van-image width="3.5rem" height="3.5rem" round :src="avatar_image" />
      <div class="ml15">
        <p class="nickname">{{user_name}}</p>
        <div class="mt13">
          <span class="name mr16">{{grade_name}}</span>
          <span class="name" v-if="is_partner==1">{{custom_name.partner_name}}</span>
        </div>
      </div>
    </div>
    <ul class="list">
      <router-link tag="li" :to="fun.getUrl('consensus_activity_integrate', { num: 1 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-jifen"></i></span>
          <span>{{custom_name.yuan_name}}</span>
        </div>
        <div class="flex">
          <span>{{usable_yuan}}</span>
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_integrate', { num: 2 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-balance_a_n1"></i></span>
          <span>{{custom_name.yuan_withdraw_limit_name}}</span>
        </div>
        <div class="flex">
          <span>{{ other_assets.yuan_quota }}</span>
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_asset', { num: 1 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-shouru"></i></span>
          <span>{{custom_name.origin_asset_name}}</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_integrate', { num: 3 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-yq_hetongzhongxin"></i></span>
          <span>{{custom_name.income_name}}</span>
        </div>
        <div class="flex">
          <span>{{ other_assets.income }}</span>
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_asset', { num: 2 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-balance_c"></i></span>
          <span>{{custom_name.reopen_name}}</span>
        </div>
        <div class="flex">
          <span>{{ other_assets.reopen }}</span>
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_integrate', { num: 4 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-huiyuanguanli-copy"></i></span>
          <span>{{custom_name.quality_name}}</span>
        </div>
        <div class="flex">
          <span>{{other_assets.quality}}</span>
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <li class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-jiaquanfenhongedu"></i></span>
          <span>加权分红奖池额度</span>
        </div>
        <div style="text-align: right; margin-right: 1rem;">{{ add_weight_bonus_pool }}</div>
      </li>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_integrate', { num: 5 ,count:other_assets.add_weight})" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-ht_content_tixian"></i></span>
          <span>加权分红额度</span>
        </div>
        <div class="flex">
          <span>{{ other_assets.add_weight }}</span>
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_integrate', { num: 6 })" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-income-cashb"></i></span>
          <span>加权分红</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_fomo_pool')" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-fomojiangchi"></i></span>
          <span>Fomo奖池</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_fomo')" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-icon_FOMO"></i></span>
          <span>Fomo加权分红</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_earnings')" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-massage_apply"></i></span>
          <span>收益记录</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_mass_intergral')"  class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-zizhutuiguang"></i></span>
          <span>{{custom_name.quality_name}}活动</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
      <router-link tag="li" :to="fun.getUrl('consensus_activity_user')" class="between">
        <div class="flex">
          <span class="iconfont-bg"><i class="iconfont icon-fontclass-renshu1"></i></span>
          <span>有效用户</span>
        </div>
        <div class="flex">
          <span><i class="iconfont icon-member_right"></i></span>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
import { Image as VanImage } from 'vant';
export default {
  components: { VanImage },
  data() {
    return {
      avatar_image: "",
      grade_name: "",
      user_name:"",
      is_partner:0,
      other_assets:{},
      custom_name:{},
      usable_yuan:0,
    };
  },
  activated() {
    this.getData();
  },
  methods: {
    getData() {
      $http.get("plugin.wise-yuan-trade.frontend.my.index", "", "").then(res => {
        if (res.result) {
          let data = res.data;
          this.avatar_image = data.avatar_image;
          this.grade_name = data.grade_name;
          this.is_partner = data.is_partner;
          this.usable_yuan = data.usable_yuan;
          this.user_name = data.user_name;
          this.other_assets  = data.other_assets;
          this.custom_name   = data.custom_name ;
          this.add_weight_bonus_pool = data.add_weight_bonus_pool;
        } else {
          this.$toast(res.msg);
        }
      })
    }
  }
};
</script>

<style scoped lang="scss">
.consensus-activity-my {
  background: linear-gradient(181deg, rgba(255, 238, 239, 0.45) 0%, #fef6f4 50%, #f7f7f7 100%);
  min-height: 100vh;
  padding-bottom: 1.5625rem;

  .mt13 {
    margin-top: 0.4063rem;
  }

  li.between {
    margin-bottom: 1.25rem;
  }

  .ml15 {
    margin-left: 0.4688rem;
  }

  .mr16 {
    margin-right: 0.5rem;
  }

  .name {
    background: linear-gradient(334deg, #ff8a4a 0%, #fbc17f 100%);
    border-radius: 0.25rem;
    color: #fff;
    padding: 0.2188rem 0.3125rem;
  }

  .nickname {
    text-align: left;
    font-size: 0.9375rem;
    font-weight: bold;
    color: #00001c;
  }

  .between {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .flex {
    display: flex;
    align-items: center;
  }

  .iconfont-bg {
    width: 2rem;
    height: 2rem;
    line-height: 2rem;
    color: #f15353;
    background: #feeded;
    border-radius: 0.75rem;
    margin-right: 0.6875rem;
  }

  .list {
    background: #fff;
    border-radius: 0.625rem;
    width: calc(100% - 1.5rem);
    margin: 0 auto;
    padding: 0.5625rem 0.75rem;
  }

  .head {
    display: flex;
    align-items: center;
    padding: 1.25rem 0.8125rem 1.0313rem;
  }
}
</style>
